package Collection.work;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

public class toarray {
    public static void main(String[] args) {
        Collection<String> c=new ArrayList<>();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        c.add("five");
        System.out.println("c:"+c);

        String[] s1=c.toArray(new String[0]);//<
        System.out.println(Arrays.toString(s1));
        String[] s2=c.toArray(new String[c.size()]);//=
        System.out.println(Arrays.toString(s2));
        String[] s3=c.toArray(new String[9]);//>
        System.out.println(Arrays.toString(s3));



        String[] s={"one","two","three","four","five"};
        System.out.println("s："+Arrays.toString(s));
        List<String> list= Arrays.asList(s);
        System.out.println("list:"+list);

        s[1]="2";
        System.out.println("list:"+list);
        System.out.println("s："+Arrays.toString(s));












//        String[] s={"one","two","three","four"};
//        String[]
    }
}
